# -*- coding: utf-8 -*-
# @Time:2021/04/27 21:48
# @Author:Cindy
from appium.webdriver.common.mobileby import MobileBy

from pages.base_page import BasePage
from pages.edit_member_page import EditMemberPage


class AddMemberPage(BasePage):

    def goto_edit_member_page(self):
        # 点击[手动输入添加]按钮
        add_by_manual_button = (MobileBy.XPATH, "//*[@text='手动输入添加']")
        self.find(add_by_manual_button).click()
        # 进入编辑成员页面
        return EditMemberPage(self.driver)

    def catch_toast(self):
        # 捕获toast
        get_toast = (MobileBy.XPATH, "//*[@class='android.widget.Toast']")
        toast = self.find(get_toast).text
        return toast

